﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DashboardModule.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the <seealso cref="DashboardModule" /> type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Client.Modules.Core.Dashboard
{
    using Hisaab.Client.Common;
    using Hisaab.Client.Modules.Core.Dashboard.View;

    using Microsoft.Practices.Prism.Modularity;
    using Microsoft.Practices.Prism.Regions;
    using Microsoft.Practices.ServiceLocation;
    using Microsoft.Practices.Unity;

    /// <summary>
    /// Defines the <seealso cref="DashboardModule"/> type.
    /// </summary>
    public class DashboardModule : IModule
    {
        /// <summary>
        /// Member variable DashboardView
        /// </summary>
        public const string DashboardView = "DashboardView";

        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public void Initialize()
        {
            var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
            regionManager.RegisterViewWithRegion(Regions.HomeViewGroup, typeof(DashboardViewButton));
            regionManager.RegisterViewWithRegion(Regions.BackStageRegion, typeof(SummaryBackStageTab));

            var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
            container.RegisterType<object, DashboardView>(DashboardView);
        }
    }
}